package org.example.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;

/**
 * @author 莫磊
 * @date 2025/8/11
 * @description
 */
@Controller
public class LoginController {

	@GetMapping("/loginPage")
	public String login() {
		return "loginPage";
	}

	@PostMapping("/login")
	public String login(String username, String password) {
		if("admin".equals(username) && "admin".equals(password)) {
			return "success";
		}
		return "loginPage";
	}
}
